PATH  Mac OS 8 and 9 Developer Documentation > Human Interface Toolbox > Icon Services and Utilities
>
Obtaining and Using Icons With Icon Services

   

Using Badges

A badge is an overlay or replacement for an icon. You can use a badge to signify that a folder contains special files, for example. Badges are described by a 'badg' resource you store in a file's resource fork or a folder's invisible icon file. Figure 1-1 shows a folder alias icon displayed in standard form and with a badge.

Figure 1-1  Folder icons displayed in standard form and with a badge

There are two steps required to use a custom badge with a file object.

There are three ways to use the data from a 'badg' resource.

  1. The customBadgeType and customBadgeCreator fields let you designate a custom badge to display on top of another icon, as shown in Figure 1-1 .

  2. The windowBadgeType and windowBadgeCreator fields let you designate which icon to display in Finder window header of the badged file or folder.

  3. The overrideType and overrideCreator fields let you designate the badge as a replacement for the standard icon for this file or folder.

The type and creator codes specified in a'badg' resource must be registered with Icon Services before you can use the badge. For more information, see Registering Icon Data.

If you supply a custom icon resource for a badge, Icon Services will use it in preference to other available data. For a complete description of the badge resource, see 'badg' .


© 1999 Apple Computer, Inc. – (Last Updated 03 Dec 99)